// 邮箱校验
export const validateEmail = (rule: any, value: any, callback: any) => {
  const pattern = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
  if (!pattern.test(value)) {
    callback(new Error("请确认邮箱格式正确"));
  } else {
    callback();
  }
};
// 手机号校验
export const validateMobile = (rule: any, value: any, callback: any) => {
  const pattern = /^1[3456789]\d{9}$/;
  if (!pattern.test(value)) {
    callback(new Error("请确认手机号格式正确"));
  } else {
    callback();
  }
};
// 密码校验
export const validatePassword = (rule: any, value: any, callback: any) => {
  const pattern = /^[^\u4e00-\u9fa5]{6,}$/;
  if (!pattern.test(value)) {
    callback(new Error("至少输入6位以上非汉字字符"));
  } else {
    callback();
  }
};
